package WrittenTest;

import java.util.Arrays;
import java.util.Scanner;

public class test24 {
    // 组队竞赛：队伍的水平值等于该队伍队员中第二高水平值
    // 算法原理：贪心 + 排序
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), pre = (3 * n) - 2;
        int[] arr = new int[3 * n];
        for (int i = 0; i < 3 * n; i++) {
            arr[i] = in.nextInt();
        }
        // 排序
        Arrays.sort(arr);
        long sum = 0;
        while (n != 0) {
            sum += arr[pre];
            n--;
            pre -= 2;
        }
        System.out.println(sum);
    }
}
